package kr.hkit.PowerJava.chapter12;

public class 물오리 extends Duck {

	@Override
	public void quack() {
		System.out.println("꽥~~~~~");
		
	}
   
public static void main(String[] args) {
	  물오리 duck01= new 물오리();
	  오리피리 duck02=new 오리피리();
	  장난감오리 duck03=new 장난감오리();
	  
	  Duck[] arrDucks = new Duck[3];
	  arrDucks[0] = duck01;
	  arrDucks[1] = duck02;
	  arrDucks[2] = duck03;
	  
    for(Duck duck : arrDucks){
    	duck.quack();
    }

}
}

class 오리피리 extends Duck{

	@Override
	public void quack() {
		System.out.println("꽥~~~~~");
		
	}
}
class 장난감오리 extends Duck{
	public void quack(){
		System.out.println("~~~~~~");
	}
}
